package com.quanyue.haircut.shop.mapper;


import com.quanyue.haircut.domain.entity.AssessImage;
import com.vhuomai.mybatis.mapper.auto.AutoMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Collection;
import java.util.List;

@Mapper
public interface AssessImageMapper extends AutoMapper <AssessImage, Integer> {
    @Select("<script>select * from qy_assess_image a where a.assess_id in "
            + "<foreach collection=\"list\" item=\"id\" index=\"index\" open=\"(\" close=\")\" separator=\",\">#{id}</foreach></script>")
    List <AssessImage> findByAccessIds(@Param("list") Collection ids);

    @Select("select a.image from qy_assess_image a where a.assess_id = #{assessId}")
    List <String> findByAccessId(@Param("assessId") Integer assessId);
}
